import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../pages/Home/Home.vue'
import City from '../pages/City/City.vue'
import Detail from '../pages/Detail/Detail.vue'
import Search from 'common/Search/Search.vue'

Vue.use(VueRouter)

const routes = [{
  path: '/',
  name: 'Home',
  component: Home
},
{
  path: '/city',
  name: 'City',
  component: City
},
{
  path: '/detail/:id',
  name: 'Detail',
  component: Detail
},
{
  path: '/Search',
  name: 'Search',
  component: Search
}]

const router = new VueRouter({
  routes,
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})

export default router
